<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH. 'controllers/layout.php');

class Cfooter extends Layout
{
	public function __construct()
	{
		parent::__construct();
	}
	
	
	public function cfooterview()
	{
		
		$param = $this->uri->ruri_to_assoc();
		
		
		$search = $param['id'];
		$config['per_page'] = 20;
		$page = $this->uri->segment(2);
		$result = $this->product_model->getAllSearchCategory($search, $page, $config['per_page']);
		$this->load->library('pagination');
		$config['base_url'] = base_url().'/san-pham-may-loc-nuoc';
		$config['total_rows'] = $result['total_record'];
		if($search != ''){
			$this->pagination->suffix = '?search='. $search;
		}
		$config['use_page_numbers'] = false;
		$config['uri_segment'] = 2;
		$config['num_links'] = 1;
		$this->pagination->initialize($config);
		$data["paging"] = $this->pagination->create_links();
	
		$data['tbl_products'] = $result['tbl_products'];
	
		$khoanggia = $this->utility_model->selectStatus('tbl_aboutprice');
		$hangsanxuat = $this->utility_model->selectStatus('tbl_origin');
		$thuonghieu = $this->utility_model->selectStatus('tbl_brand');
		$congxuat = $this->utility_model->selectStatus('tbl_capacity');
				
		$detaildichvu = $this->utility_model->getDetail('tbl_cfooter', 'id',$param['id']);
		
		
	
		$this->_data['main_container'] = $this->load->view('home/cfooter_view', array(
				'tbl_products' => $data['tbl_products'],
				'khoanggia' => $khoanggia,
				'thuonghieu' => $thuonghieu,
				'hangsanxuat' => $hangsanxuat,
				'detaildichvu' => $detaildichvu,
				'congxuat' => $congxuat,
	
				'pagination' => $data["paging"],
		), true);
		$this->load->view('home/layout_view', $this->_data);
	}
	
	

	
}